
from ultralytics import YOLO

weights = r"/home/champrin/Desktop/校赛小球数据集/目标识别/Engineering training 2.v1i.yolov8/weights/best.pt"

model = YOLO(weights)  # load FP32 model

results = model.predict(source=r"/home/champrin/Desktop/校赛小球数据集/目标识别/area.v1i.yolov8/image",
imgsz=640,
                        conf=0.1,
                        iou=0.8,
                        save=True,
                        save_txt=True
                        )
